package ai.plantdata.mvc.test;

import ai.plantdata.mvc.controller.StudentController;
import ai.plantdata.mvc.model.Student;
import ai.plantdata.mvc.view.StudentView;

/**
 * @Author: WangHui
 * @Date: 2020/12/24 15:30
 * @Description:
 */
public class MVCPatternDemo {
    public static void main(String[] args) {
        Student student = retrieveStudentFromDatabase();
        StudentView studentView = new StudentView();
        StudentController studentController = new StudentController(student, studentView);
        studentController.updateView();
        student.setName("John");
        studentController.updateView();
    }
    private static Student retrieveStudentFromDatabase(){
        Student student = new Student();
        student.setName("Rebort");
        student.setRollNo("10");
        return student;
    }
}
